package com.numberone.master.modules.recharge.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.numberone.master.common.persistence.Page;
import com.numberone.master.common.service.CrudService;
import com.numberone.master.modules.recharge.entity.Package;
import com.numberone.master.modules.recharge.dao.PackageDao;

/**
 * 物联卡套餐Service
 * @author chengkang
 * @version 2018-02-11
 */
@Service
@Transactional(readOnly = true)
public class PackageService extends CrudService<PackageDao, Package> {
	
	@Autowired
	private PackageDao packageDao;
	
	public Package get(String id) {
		return packageDao.get(id);
	}
	
	public List<Package> findList(Package p) {
		return super.findList(p);
	}
	
	public Page<Package> findPage(Page<Package> page, Package p) {
		return super.findPage(page, p);
	}
	
	@Transactional(readOnly = false)
	public void save(Package p) {
		super.save(p);
	}

	@Transactional(readOnly = false)
	public void update(Package p) {
		super.update(p);
	}
	
	@Transactional(readOnly = false)
	public void delete(Package p) {
		super.delete(p);
	}
	
	public List<Package> packageList(Integer id,Integer office_id) {
		return packageDao.packageList(id, office_id);
	}
	
	public List<Package> getPackageListByOfficeId(String office_id) {
		return packageDao.getPackageListByOfficeId(office_id);
	}
	public	Package getTaocan2ByTctype(String tctype){
		return packageDao.getTaocan2ByTctype(tctype);
	}
	
	public Package getTaocan2ByStoreid(String officeId,String tcId){
		return packageDao.getTaocan2ByStoreid(officeId, tcId);
	}
	
	public List<Package> getTaocan2sByStoreid(String office_id,String check_store_id){
		return packageDao.getTaocan2sByStoreid(office_id, check_store_id);
	}
	public Package isPackageCount(String officeId,String tcId){
		return packageDao.isPackageCount(officeId, tcId);
	}
	
	
}